package config;

import org.nutz.dao.Dao;
import org.nutz.dao.impl.NutDao;

import com.alibaba.druid.pool.DruidDataSource;


public class SingletonDruidDataSource extends DruidDataSource {
	private static DruidDataSource INSTANCE;
	private SingletonDruidDataSource(){ 
		setDriverClassName("com.mysql.jdbc.Driver");
		setUrl("jdbc:mysql://19mm.com:3306/carblog?characterEncoding=UTF-8");
		setUsername("root");
		setPassword("guavaguava00");
	}
	public static DruidDataSource getInstance() {
		if(INSTANCE==null){
			INSTANCE=new SingletonDruidDataSource();
		}
		return INSTANCE;
	}
	public static void buildTable(Class class2){
		Dao dao = new NutDao(getInstance());
		dao.create(class2, false);
	}
}
